package com.dundun.pattern.strategy;

public class StrategyMain {
    public static void main(String[] args) {
        Player p1 = new Player("Taro", new WinStategy(314));
        Player p2 = new Player("Hana", new PropStrategy(15));
        for(int i=0; i<10000; ++i) {
            Hand nextHand1 = p1.nextHand();
            Hand nextHand2 = p2.nextHand();
            if(nextHand1.isStrongerThan(nextHand2)) {
                p1.win();
                p2.lose();
            } else if(nextHand1.isWeakerThan(nextHand2)) {
                p2.win();
                p1.lose();
            } else {
                p1.even();
                p2.even();
            }
        }
        System.out.println("total result:");
        System.out.println(p1);
        System.out.println(p2);
    }
}
